{extend name="base"/}
{block name="content"}
<div class="row">
	<div class="col-xs-9 col-sm-9 col-md-9  col-lg-9">

    {if condition="input('param.user_id')"}
    <h5>用户编辑</h5>
    {else/}
    <h5>新增用户</h5>
    {/if}

	</div>
</div>
<hr/>
<form method="post">
<div class="row">
	<div class="form-horizontal user_set_wrap" role="form">
		<div class="form-group">
			<label class="col-xs-2 col-sm-2 col-md-2 col-lg-2 control-label">姓名</label>
			<div class="col-xs-6 col-sm-6 col-md-6 col-lg-6">
				<input type="text" class="form-control" name="username" placeholder="请输入姓名" value="{$oldRoleData['username']}">
			</div>
		</div>
		<div class="form-group">
			<label class="col-xs-2 col-sm-2 col-md-2 col-lg-2 control-label" >password</label>
			<div class="col-xs-6 col-sm-6 col-md-6 col-lg-6">
				<input type="password" class="form-control" name="password_new" placeholder="请输入password" value="">
			</div>
		</div>
        
        <!--所属角色-->
        <div class="form-group">
            <label class="col-xs-2 col-sm-2 col-md-2 col-lg-2 control-label" >所属角色</label>
            <div class="col-xs-6 col-sm-6 col-md-6 col-lg-6">
                <div class="checkbox">
                    {foreach name="roleList" item="vo"}
                    <label>
                        <input type="checkbox" name="role_ids[]" value="{$vo['id']}"
{present name="oldSelectData"}
	{foreach name="oldSelectData" item="ko"}
		{if condition="$ko['role_id'] === $vo['id']"}
			checked
		{/if}
	{/foreach}
{/present}
                        />
						{$vo['name']}
                    </label>
                    {/foreach}
                </div>
            </div>
        </div>
        
		<div class="col-xs-6 col-xs-offset-2 col-sm-6 col-sm-offset-2 col-md-6  col-md-offset-2 col-lg-6 col-sm-lg-2 ">
          	<input type="hidden" name="user_id" value="{:input('param.user_id')}"> 
          	<input type="hidden" name="password_old" value="{$oldRoleData['password']}">
			<button type="sublime" class="btn btn-primary pull-right  save">确定</button>
		</div>
	</div>
</div>
</form>
{/block}